import WeatherService from "../model/weather/Service";

let asyncqueryWeather = (playload: any) => {
  return async (dispatch: any) => {
    return new Promise(async (resolve, reject) => {
      //先查询
      let { data } = await WeatherService.query(playload);
      if (data) {
        resolve({
          msg: "成功",
          data,
        });
      } else {
        reject({ msg: "失败", data });
      }
    });
  };
};

export { asyncqueryWeather };
